package com.xiaouyudeguang.common.annotation;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.lang.annotation.*;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
@ResponseBody
@RequestMapping
@DubboService
@RefreshScope
public @interface ApiResource {

    /**
     * bean名称
     *
     * @return
     */
    @AliasFor(annotation = RequestMapping.class)
    String path();

    /**
     * 标签
     *
     * @return
     */
    String[] tags();

    /**
     * 描述
     *
     * @return
     */
    String description() default "";

    /**
     * 自定义请求地址
     *
     * @return
     */
    String url() default "";

    /**
     * 别名
     *
     * @return
     */
    String alias() default "";

    /**
     * 是否输出切面日志
     */
    boolean close() default false;

    /**
     * 是否开放
     *
     * @return
     */
    boolean isOpen() default false;

    /**
     * 是否开放
     *
     * @return
     */
    Class<?> entityType() default Void.class;

    /**
     *
     * @return
     */
    String dataSource() default "";

}
